Remove a few more explicit type conversions, now that stringify is fixed.
authorEwan Mellor <ewan@xensource.com>
Thu, 28 Dec 2006 16:52:44 +0000 (16:52 +0000)
committerEwan Mellor <ewan@xensource.com>
Thu, 28 Dec 2006 16:52:44 +0000 (16:52 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendPIF.py
tools/python/xen/xend/XendStorageRepository.py

index aea03e0b165448297c0ee3be63bffd62757a3f40..b6f2345c363f34ced717de5a118de4a9bd8ae15e 100644 (file)
@@ -123,13 +123,13 @@ class XendPIF:
     def get_record(self, transient = True):
         result = {'name': self.name,
                   'MAC': self.mac,
-                  'MTU': str(self.mtu),
+                  'MTU': self.mtu,
                   'VLAN': self.vlan,
                   'host': self.host.uuid,
                   'network': self.network.uuid}
         if transient:
-            result['io_read_kbs'] = str(self.get_io_read_kbs())
-            result['io_write_kbs'] = str(self.get_io_write_kbs())
+            result['io_read_kbs'] = self.get_io_read_kbs()
+            result['io_write_kbs'] = self.get_io_write_kbs()
         return result
 
 
index 3ab5480a814927fe3cc56c0115c3f11ed2a6fc88..fd3a5980cd79d63bfd31dc8ee53e797b128ce055 100644 (file)
@@ -103,16 +103,16 @@ class XendStorageRepository:
         retval = {'uuid': self.uuid,
                   'name_label': self.name_label,
                   'name_description': self.name_description,
-                  'virtual_allocation': str(self.storage_alloc),
-                  'physical_utilisation': str(self.storage_used),
-                  'physical_size': str(self.storage_max),
+                  'virtual_allocation': self.storage_alloc,
+                  'physical_utilisation': self.storage_used,
+                  'physical_size': self.storage_max,
                   'type': self.type,
                   'location': self.location,
                   'VDIs': self.images.keys()}
         
         if self.storage_max == XEND_STORAGE_NO_MAXIMUM:
             stfs = os.statvfs(self.location)
-            retval['physical_size'] = str(stfs.f_blocks * stfs.f_frsize)
+            retval['physical_size'] = stfs.f_blocks * stfs.f_frsize
 
         return retval